package com.ropeok.controller;

import com.ropeok.domain.ResponseResult;
import com.ropeok.domain.User;
import com.ropeok.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: training-mission
 * @BelongsPackage: com.ropeok.controller
 * @Author: zhofeifan
 * @CreateTime: 2022-09-21  11:22
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping ("/user/login")
    public ResponseResult login(@RequestBody User user){
        //登录
       return loginService.login(user);
    }
    @RequestMapping("/user/logout")
    public ResponseResult logout(){
      return  loginService.logout();
    }
}

